<?php
class Person_model extends CI_Model {
	
	private $alumnos= 'alumnos';
	
	function __construct(){
		parent::__construct();
	}
	
	function list_all(){
		$this->db->order_by('idAlumnos','asc');
		return $this->db->get($alumnos);
	}
	
	function count_all(){
		return $this->db->count_all($this->alumnos);
	}
	
	function get_paged_list($limit = 10, $offset = 0){
		$this->db->order_by('idAlumnos','asc');
		return $this->db->get($this->alumnos, $limit, $offset);
	}
	
	function get_by_id($idAlumnos){
		$this->db->where('idAlumnos', $idAlumnos);
		return $this->db->get($this->alumnos);
	}
	
	function save($person){
		$this->db->insert($this->alumnos, $person);
		return $this->db->insert_id();
	}
	
	function update($idAlumnos, $person){
		$this->db->where('idAlumnos', $idAlumnos);
		$this->db->update($this->alumnos, $person);
	}
	
	function delete($id){
		$this->db->where('idAlumnos', $idAlumnos);
		$this->db->delete($this->alumnos);
	}
}
?>